﻿<?xml version="1.0" encoding="utf-8" ?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="BabelMap" type="BabelMap" />
  <xs:complexType name="BabelMap">
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
      <xs:element minOccurs="0" name="TargetAssembly" type="TargetAssemblyMap" />
    </xs:sequence>
    <xs:attribute fixed="2.0" name="version" type="xs:string" use="required" />
  </xs:complexType>
  <xs:complexType name="TargetAssemblyMap">
    <xs:sequence>
      <xs:choice minOccurs="1" maxOccurs="unbounded">
        <xs:element minOccurs="0" maxOccurs="1" name="CmdLine" type="CmdLineMap" />
        <xs:element minOccurs="0" name="MergedAssemblies" type="MergedAssembliesMap" />
        <xs:element minOccurs="0" name="EmbeddedAssemblies" type="EmbeddedAssembliesMap" />
        <xs:element minOccurs="0" maxOccurs="1" name="DeadCode">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" maxOccurs="unbounded" name="Method" type="MethodMap" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="0" maxOccurs="unbounded" name="Namespace" type="NamespaceMap" />
        <xs:element minOccurs="0" maxOccurs="1" name="EncryptedStrings" type="EncryptedStringsMap" />
        <xs:element minOccurs="0" maxOccurs="1" name="EncryptedMethods" type="EncryptedMethodsMap" />
        <xs:element minOccurs="0" maxOccurs="1" name="EncryptedResources" type="EncryptedResourcesMap" />
      </xs:choice>
    </xs:sequence>
    <xs:attribute name="fullName" type="xs:string" use="required" />
    <xs:attribute name="creationTime" type="xs:dateTime" use="optional" />
    <xs:attribute name="lastModifiedTime" type="xs:dateTime" use="optional" />
  </xs:complexType>
  <xs:complexType name="AssemblyMap">
    <xs:attribute name="fullName" type="xs:string" use="required" />
    <xs:attribute name="creationTime" type="xs:dateTime" use="optional" />
    <xs:attribute name="lastModifiedTime" type="xs:dateTime" use="optional" />
  </xs:complexType>
  <xs:complexType name="MergedAssembliesMap">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="MergedAssembly" type="AssemblyMap" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="EmbeddedAssembliesMap">
    <xs:complexContent mixed="false">
      <xs:extension base="ResourceMap">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="unbounded" name="EmbeddedAssembly" type="AssemblyMap" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="NamespaceMap">
    <xs:sequence>
      <xs:choice maxOccurs="unbounded">
        <xs:element minOccurs="0" maxOccurs="unbounded" name="Class" type="TypeMap" />
        <xs:element minOccurs="0" maxOccurs="unbounded" name="Enum" type="TypeMap" />
        <xs:element minOccurs="0" maxOccurs="unbounded" name="Interface" type="TypeMap" />
        <xs:element minOccurs="0" maxOccurs="unbounded" name="Struct" type="TypeMap" />
      </xs:choice>
    </xs:sequence>
    <xs:attribute name="name" type="xs:string" use="required" />
  </xs:complexType>
  <xs:complexType name="TypeMap">
    <xs:sequence minOccurs="0">
      <xs:choice maxOccurs="unbounded">
        <xs:element minOccurs="0" name="GenericParameters">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" maxOccurs="unbounded" name="GenericParameter" type="GenericParameterMap" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="0" maxOccurs="unbounded" name="Enum" type="TypeMap" />
        <xs:element minOccurs="0" maxOccurs="unbounded" name="Class" type="TypeMap" />
        <xs:element minOccurs="0" maxOccurs="unbounded" name="Struct" type="TypeMap" />
        <xs:element minOccurs="0" maxOccurs="unbounded" name="Interface" type="TypeMap" />
        <xs:element minOccurs="0" maxOccurs="unbounded" name="Event" type="EventMap" />
        <xs:element minOccurs="0" maxOccurs="unbounded" name="Property" type="PropertyMap" />
        <xs:element minOccurs="0" maxOccurs="unbounded" name="Method" type="MethodMap" />
        <xs:element minOccurs="0" maxOccurs="unbounded" name="Field" type="FieldMap" />
      </xs:choice>
    </xs:sequence>
    <xs:attribute name="id" type="xs:ID" use="optional" />
    <xs:attribute name="name" type="xs:string" use="optional" />
    <xs:attribute name="access" type="xs:string" use="optional" />
    <xs:attribute name="newName" type="xs:string" use="optional" />
    <xs:attribute name="newFullName" type="xs:string" use="optional" />
    <xs:attribute name="isSealed" type="xs:boolean" use="optional" />
    <xs:attribute name="isStatic" type="xs:boolean" use="optional" />
    <xs:attribute name="isAbstract" type="xs:boolean" use="optional" />
  </xs:complexType>
  <xs:complexType name="MethodMap">
    <xs:sequence>
      <xs:element minOccurs="0" name="ReturnType">
        <xs:complexType>
          <xs:complexContent mixed="false">
            <xs:extension base="ReturnTypeMap" />
          </xs:complexContent>
        </xs:complexType>
      </xs:element>
      <xs:element minOccurs="0" name="Parameters">
        <xs:complexType>
          <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="unbounded" name="Parameter">
              <xs:complexType>
                <xs:complexContent mixed="false">
                  <xs:extension base="ParameterMap" />
                </xs:complexContent>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element minOccurs="0" name="GenericParameters">
        <xs:complexType>
          <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="unbounded" name="GenericParameter" type="GenericParameterMap" />
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="id" type="xs:ID" use="optional" />
    <xs:attribute name="idRef" type="xs:IDREF" use="optional" />
    <xs:attribute name="name" type="xs:string" use="optional" />
    <xs:attribute name="access" type="xs:string" use="optional" />
    <xs:attribute name="isVirtual" type="xs:boolean" use="optional" />
    <xs:attribute name="newName" type="xs:string" use="optional" />
    <xs:attribute name="isStatic" type="xs:boolean" use="optional" />
    <xs:attribute name="declaringType" type="xs:string" />
  </xs:complexType>
  <xs:complexType name="PropertyMap">
    <xs:sequence>
      <xs:element minOccurs="0" name="Get" type="MethodMap" />
      <xs:element minOccurs="0" name="Set" type="MethodMap" />
    </xs:sequence>
    <xs:attribute name="id" type="xs:ID" use="optional" />
    <xs:attribute name="name" type="xs:string" use="optional" />
    <xs:attribute name="newName" type="xs:string" use="optional" />
  </xs:complexType>
  <xs:complexType name="FieldMap">
    <xs:attribute name="id" type="xs:ID" use="optional" />
    <xs:attribute name="name" type="xs:string" use="optional" />
    <xs:attribute name="type" type="xs:string" use="optional" />
    <xs:attribute name="access" type="xs:string" use="optional" />
    <xs:attribute name="newName" type="xs:string" use="optional" />
    <xs:attribute name="isStatic" type="xs:boolean" use="optional" />
  </xs:complexType>
  <xs:complexType name="EventMap">
    <xs:sequence>
      <xs:element minOccurs="0" name="Add" type="MethodMap" />
      <xs:element minOccurs="0" name="Remove" type="MethodMap" />
      <xs:element minOccurs="0" name="Invoke" type="MethodMap" />
    </xs:sequence>
    <xs:attribute name="id" type="xs:ID" use="optional" />
    <xs:attribute name="name" type="xs:string" use="optional" />
    <xs:attribute name="newName" type="xs:string" use="optional" />
  </xs:complexType>
  <xs:complexType name="GenericParameterMap">
    <xs:attribute name="name" type="xs:string" use="optional" />
    <xs:attribute name="position" type="xs:int" use="optional" />
  </xs:complexType>
  <xs:complexType name="CmdLineMap">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="startTime" type="xs:dateTime" use="optional" />
        <xs:attribute name="endTime" type="xs:dateTime" use="optional" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:complexType name="ReturnTypeMap">
    <xs:attribute name="type" type="xs:string" />
  </xs:complexType>
  <xs:complexType name="ParameterMap">
    <xs:attribute name="name" type="xs:string" use="optional" />
    <xs:attribute name="type" type="xs:string" use="optional" />
    <xs:attribute name="newName" type="xs:string" />
    <xs:attribute name="isIn" type="xs:boolean" />
    <xs:attribute name="isOut" type="xs:boolean" />
  </xs:complexType>
  <xs:complexType name="ResourceMap">
    <xs:attribute name="id" type="xs:ID" />
    <xs:attribute name="name" type="xs:string" />
    <xs:attribute name="size" type="xs:int" />
  </xs:complexType>
  <xs:complexType name="EncryptedMethodsMap">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="EncryptedMethodsSource" type="EncryptedMethodsSourceMap" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="EncryptedMethodsSourceMap">
    <xs:complexContent mixed="false">
      <xs:extension base="ResourceMap">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="unbounded" name="Method" type="MethodMap" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="EncryptedResourcesMap">
    <xs:complexContent mixed="false">
      <xs:extension base="ResourceMap">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="unbounded" name="Resource" type="ResourceMap" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="EncryptedStringsMap">
    <xs:complexContent mixed="false">
      <xs:extension base="ResourceMap">
        <xs:sequence>
          <xs:element name="DecryptMethod" type="MethodMap" />
          <xs:element minOccurs="0" maxOccurs="unbounded" name="EncryptedString" type="EncryptedStringMap" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="EncryptedStringMap">
    <xs:sequence>
      <xs:element minOccurs="1" name="SourceString" type="xs:string" />
      <xs:element minOccurs="0" name="Key" type="xs:int" />
      <xs:element minOccurs="0" name="EncryptedData" type="xs:base64Binary" />
    </xs:sequence>
    <xs:attribute name="id" type="xs:ID" />
  </xs:complexType>
</xs:schema>